#! /bin/bash

set -e

echo 'tar -zxvf /opt/software/hadoop-3.1.3.tar.gz -C /opt/module/'
tar -zxvf /opt/software/hadoop-3.1.3.tar.gz -C /opt/module/

tee -a /etc/profile.d/set_env.sh <<-'EOF'
#HADOOP_HOME
export HADOOP_HOME=/opt/module/hadoop-3.1.3
export PATH=$PATH:$HADOOP_HOME/bin
export PATH=$PATH:$HADOOP_HOME/sbin

EOF

source /etc/profile

hadoop version